# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=m3-gen
pkgver=7.7c656cc
pkgrel=4
groups=('blackarch' 'blackarch-exploitation')
pkgdesc='Generates Malicious Macro and Execute Powershell or Shellcode via MSBuild Application Whitelisting Bypass, this tool intended for adversary simulation and red teaming purpose.'
url='https://github.com/infosecn1nja/MaliciousMacroMSBuild'
arch=('any')
license=('GPL2')
depends=('python2')
makedepends=('git')
source=("$pkgname::git+https://github.com/infosecn1nja/MaliciousMacroMSBuild.git")
sha512sums=('SKIP')

prepare() {
  cd $pkgname

  sed -i 's|bin/python|bin/python2|g' "$pkgname.py"
}

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

